3.169 \(\int \cos ^3(e+f x) (a+b \sec ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=49 \[ -\frac{a^2 \sin ^3(e+f x)}{3 f}+\frac{a (a+2 b) \sin (e+f x)}{f}+\frac{b^2 \tanh ^{-1}(\sin (e+f x))}{f} \]

[Out]

(b^2*ArcTanh[Sin[e + f*x]])/f + (a*(a + 2*b)*Sin[e + f*x])/f - (a^2*Sin[e + f*x]^3)/(3*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0608709, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {4147, 390, 206} \[ -\frac{a^2 \sin ^3(e+f x)}{3 f}+\frac{a (a+2 b) \sin (e+f x)}{f}+\frac{b^2 \tanh ^{-1}(\sin (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]^3*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(b^2*ArcTanh[Sin[e + f*x]])/f + (a*(a + 2*b)*Sin[e + f*x])/f - (a^2*Sin[e + f*x]^3)/(3*f)

Rule 4147

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fr
eeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2*x^2)^
((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n
/2] && IntegerQ[p]

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \cos ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b-a x^2\right )^2}{1-x^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (a (a+2 b)-a^2 x^2+\frac{b^2}{1-x^2}\right ) \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{a (a+2 b) \sin (e+f x)}{f}-\frac{a^2 \sin ^3(e+f x)}{3 f}+\frac{b^2 \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{b^2 \tanh ^{-1}(\sin (e+f x))}{f}+\frac{a (a+2 b) \sin (e+f x)}{f}-\frac{a^2 \sin ^3(e+f x)}{3 f}\\ \end{align*}

Mathematica [A]  time = 0.0250815, size = 72, normalized size = 1.47 \[ -\frac{a^2 \sin ^3(e+f x)}{3 f}+\frac{a^2 \sin (e+f x)}{f}+\frac{2 a b \sin (e) \cos (f x)}{f}+\frac{2 a b \cos (e) \sin (f x)}{f}+\frac{b^2 \tanh ^{-1}(\sin (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]^3*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(b^2*ArcTanh[Sin[e + f*x]])/f + (2*a*b*Cos[f*x]*Sin[e])/f + (2*a*b*Cos[e]*Sin[f*x])/f + (a^2*Sin[e + f*x])/f -
 (a^2*Sin[e + f*x]^3)/(3*f)

________________________________________________________________________________________

Maple [A]  time = 0.059, size = 72, normalized size = 1.5 \begin{align*}{\frac{ \left ( \cos \left ( fx+e \right ) \right ) ^{2}\sin \left ( fx+e \right ){a}^{2}}{3\,f}}+{\frac{2\,{a}^{2}\sin \left ( fx+e \right ) }{3\,f}}+2\,{\frac{ab\sin \left ( fx+e \right ) }{f}}+{\frac{{b}^{2}\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)^3*(a+b*sec(f*x+e)^2)^2,x)

[Out]

1/3/f*cos(f*x+e)^2*sin(f*x+e)*a^2+2/3*a^2*sin(f*x+e)/f+2/f*a*b*sin(f*x+e)+1/f*b^2*ln(sec(f*x+e)+tan(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 0.986582, size = 85, normalized size = 1.73 \begin{align*} -\frac{2 \, a^{2} \sin \left (f x + e\right )^{3} - 3 \, b^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, b^{2} \log \left (\sin \left (f x + e\right ) - 1\right ) - 6 \,{\left (a^{2} + 2 \, a b\right )} \sin \left (f x + e\right )}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/6*(2*a^2*sin(f*x + e)^3 - 3*b^2*log(sin(f*x + e) + 1) + 3*b^2*log(sin(f*x + e) - 1) - 6*(a^2 + 2*a*b)*sin(f
*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 0.512509, size = 165, normalized size = 3.37 \begin{align*} \frac{3 \, b^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, b^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \,{\left (a^{2} \cos \left (f x + e\right )^{2} + 2 \, a^{2} + 6 \, a b\right )} \sin \left (f x + e\right )}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/6*(3*b^2*log(sin(f*x + e) + 1) - 3*b^2*log(-sin(f*x + e) + 1) + 2*(a^2*cos(f*x + e)^2 + 2*a^2 + 6*a*b)*sin(f
*x + e))/f

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)**3*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.27523, size = 101, normalized size = 2.06 \begin{align*} -\frac{2 \, a^{2} \sin \left (f x + e\right )^{3} - 3 \, b^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, b^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 6 \, a^{2} \sin \left (f x + e\right ) - 12 \, a b \sin \left (f x + e\right )}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)^3*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

-1/6*(2*a^2*sin(f*x + e)^3 - 3*b^2*log(sin(f*x + e) + 1) + 3*b^2*log(-sin(f*x + e) + 1) - 6*a^2*sin(f*x + e) -
 12*a*b*sin(f*x + e))/f